﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WUCIndexShare.ascx.cs"
    Inherits="NJL.Web.Controls.WUCIndexShare" %>
<%@ Import Namespace="Royalsoft.Common" %>
<div>
    <div class="leftPick f_left">
        <div class="box cleanFlex">
            <div class="title">
                <h2 class="notice f_left">
                    有些好玩的您可以在这里抢先体验</h2>
            </div>
            <div class="cont" style="width: 710px; _width: 720px; margin: 0 auto; padding-left: 20px;
                _padding-left: 0px; overflow: hidden;">
                <ul class="imglist">
                    <%
                        //Random rondom = new Random();
                        //for (int i = 0; i < LIST_SERVICE.Count; i++)
                        //{
                        //    int j = rondom.Next(0, LIST_SERVICE.Count);
                        //    if (!LIST_Company.Contains(LIST_SERVICE[j]))
                        //    {
                        //        LIST_Company.Add(LIST_SERVICE[j]);
                        //    }
                        //}
                        //if (LIST_Company.Count >= 8)
                        //{
                        for (int i = 0; i < LIST_SERVICE.Count; i++)
                        {
                    %>
                    <li style="width: 155px; height: 160px;"><a target="_blank" title="<%=LIST_SERVICE[i].ACTIVE_NAME %>"
                        href="/shangpu/<%=LIST_SERVICE[i].NJL_COMPANY_ID %>-huodong-<%=LIST_SERVICE[i].ID %>.html">
                        <img width="147px" height="105px" style="display: block;" alt="<%=LIST_SERVICE[i].ACTIVE_NAME %>"
                            src="<%=LIST_SERVICE[i].IMAGE_CODE!=""?GetImageUrl(LIST_SERVICE[i].IMAGE_CODE,"1"):"/images/nopic.jpg" %>"
                            class="picBor" /></a>
                        <p style="margin-top: 3px;">
                            <span class="f_right"><a target="_blank" href="/shangpu/<%=LIST_SERVICE[i].NJL_COMPANY_ID %>-huodong-<%=LIST_SERVICE[i].ID %>.html" class="joinlink" title="我要参与"></a></span><a target="_blank"
                                class="font14" title="<%=LIST_SERVICE[i].ACTIVE_NAME %>" href="/shangpu/<%=LIST_SERVICE[i].NJL_COMPANY_ID %>-huodong-<%=LIST_SERVICE[i].ID %>.html">
                                <%if (LIST_SERVICE[i].ACTIVE_NAME.Length > 18) Response.Write(LIST_SERVICE[i].ACTIVE_NAME.Substring(0, 18) + "..."); else Response.Write(LIST_SERVICE[i].ACTIVE_NAME); %>
                            </a>
                        </p>
                    </li>
                    <%
                        }
                    %>
                </ul>
            </div>
            <div class="cleanFlex" style="height:11px;">
            </div>
        </div>
    </div>
    <!--分享-->
    <div class="rightshare f_right">
<script type="text/javascript">
    (function ($) {
        $.fn.extend({
            Scroll: function (opt, callback) {
                //参数初始化
                if (!opt) var opt = {};
                var _btnUp = $("#" + opt.up); //Shawphy:向上按钮
                var _btnDown = $("#" + opt.down); //Shawphy:向下按钮
                var timerID;
                var _this = this.eq(0).find("ul:first");
                var lineH = _this.find("li:first").height(), //获取行高
                        line = opt.line ? parseInt(opt.line, 10) : parseInt(this.height() / lineH, 10), //每次滚动的行数，默认为一屏，即父容器高度
                        speed = opt.speed ? parseInt(opt.speed, 10) : 500; //卷动速度，数值越大，速度越慢（毫秒）
                timer = opt.timer //?parseInt(opt.timer,10):3000; //滚动的时间间隔（毫秒）
                if (line == 0) line = 1;
                var upHeight = 0 - line * lineH;
                //滚动函数
                var scrollUp = function () {
                    _btnUp.unbind("click", scrollUp); //Shawphy:取消向上按钮的函数绑定
                    _this.animate({
                        marginTop: upHeight
                    }, speed, function () {
                        for (i = 1; i <= line; i++) {
                            _this.find("li:first").appendTo(_this);
                        }
                        _this.css({ marginTop: 0 });
                        _btnUp.bind("click", scrollUp); //Shawphy:绑定向上按钮的点击事件
                    });

                }
                //Shawphy:向下翻页函数
                var scrollDown = function () {
                    _btnDown.unbind("click", scrollDown);
                    for (i = 1; i <= line; i++) {
                        _this.find("li:last").show().prependTo(_this);
                    }
                    _this.css({ marginTop: upHeight });
                    _this.animate({
                        marginTop: 0
                    }, speed, function () {
                        _btnDown.bind("click", scrollDown);
                    });
                }
                //Shawphy:自动播放
                var autoPlay = function () {
                    if (timer) timerID = window.setInterval(scrollUp, timer);
                };
                var autoStop = function () {
                    if (timer) window.clearInterval(timerID);
                };
                //鼠标事件绑定
                _this.hover(autoStop, autoPlay).mouseout();
                _btnUp.css("cursor", "pointer").click(scrollUp).hover(autoStop, autoPlay); //Shawphy:向上向下鼠标事件绑定
                _btnDown.css("cursor", "pointer").click(scrollDown).hover(autoStop, autoPlay);

            }
        })
    })(jQuery);

    $(document).ready(function () {
        $("#scrollDiv").Scroll({ line: 1, speed: 1000, timer: 3000, up: "btn1", down: "btn2" });
    });
</script>
        <div class="box" style="height: 393px; width:250px; overflow:hidden; display:<%if(LIST_COMPANY.Count>0) Response.Write("block"); else Response.Write("none");%>;">
            <div class="title">
                <h2 class="bookIndex">
                    </h2>
            </div>
            <div id="scrollDiv" style="height:340px; overflow:hidden">
                <ul>
            <%
                for (int i = 0; i < LIST_COMPANY.Count; i++)
                {
                    LIST_BOOK = bllBook.GetModelList(3, "TARGET_ID='" + LIST_COMPANY[i].ID + "'", "SORT DESC");
                    %>
                    <li style="height:340px">
            <div class="cont"> 
                    <p class="centeralign m_top_10">
                        <a target="_blank" title="<%=LIST_COMPANY[i].COMPANY_NAME %>" href="/shangpu/<%=LIST_COMPANY[i].ID %>-index.html">
                            <img src="<%=GetImageUrl(LIST_COMPANY[i].IMAGE_CODE,"C1") %>" alt="<%=LIST_COMPANY[i].COMPANY_NAME %>"  style="width:160px;height:120px;" class="picBor" />
                        </a>
                    </p>
                    <p class="cleanFlex centeralign font14">
                        <strong><a target="_blank" title="<%=LIST_COMPANY[i].COMPANY_NAME %>" href="/shangpu/<%=LIST_COMPANY[i].ID %>-index.html" class="orange"><%=LIST_COMPANY[i].COMPANY_NAME%></a></strong>
                    </p>
                   
                
                <!--票务信息-->
                <div class="cleanFlex">
                    <table cellpadding="0" cellspacing="0" class="tabshare" width="100%">
                        <tr>
                            <th>类型</th>
                            <th>门市价</th>
                            <th>本店价</th>
                            <th width="35%">支付方式</th>
                        </tr>
            <%
    for (int j = 0; j < LIST_BOOK.Count; j++)
    {
            %>
            <tr>
                <td>
                    <a href='/CompanyOrder.aspx?id=<%=LIST_COMPANY[i].ID %>&bid=<%=LIST_BOOK[j].ID %>'
                        style='color: #195CB5' title='<%=LIST_BOOK[j].BOOK_INTRO %>' target="_blank">
                        <%=PageValidate.SqlText(LIST_BOOK[j].BOOK_NAME,5)%></a>
                </td>
                <td>
                    <del>¥<%=LIST_BOOK[j].MARKET_PRICE.Value.ToString("#")%></del>
                </td>
                <td>
                    <span class="orange">¥<%=LIST_BOOK[j].LOCAL_PRICE.Value.ToString("#")%></span>
                </td>
                <td>
                    <span>
                         <a href="/CompanyOrder2.aspx?id=<%=LIST_COMPANY[i].ID %>&bid=<%=LIST_BOOK[j].ID%>"
                            target="_blank" <%if(LIST_BOOK[j].NJL_CS_BOOK_PAY_TYPE_CODE=="1") Response.Write("class=\"ding02\""); else Response.Write("class=\"ding\""); %> style="cursor: pointer"></a>
                        <%=GetBookPayType(LIST_BOOK[j].NJL_CS_BOOK_PAY_TYPE_CODE)%>
                       </span>
                </td>
            </tr>
            <%
    }
            %>
                    </table>
                </div>
            </div>
                    </li>
                    <%
                }
            %>
                </ul>
            </div>
            <div class="foodindextitle" style="background:none; width:250px;">
                <p>
                    <span class="pre"><a id="btn2"  title="上一个"></a></span><span class="next"><a id="btn1"  style="width:19px;" title="下一个"></a></span>
                </p>
            </div>
        </div>
        <div class="box" style="height: 354px; display:<%if(LIST_COMPANY.Count>0) Response.Write("none"); else Response.Write("block");%>;">
            <div class="title">
                <span><a target="_blank" href="/xcgc/">查看更多</a></span>
                <h2>
                    都是游客们回来讲的</h2>
            </div>
            <div class="cont">
                <ul class="arrowList02">
                    <%
                for (int i = 0; i < LIST_NEWS.Count; i++)
                {
                    %>
                    <li class="cleanFlex">
                            <span>
                                <%=LIST_NEWS[i].CREATE_DATE_TIME.Value.ToString("yyyy-MM-dd")%>
                            </span>
                            <strong class="font14">
                                <a target="_blank" title="<%=LIST_NEWS[i].NEWS_TITLE %>" href="/wanjia/<%=LIST_NEWS[i].NJL_PERSON_ID %>-youji-<%=LIST_NEWS[i].ID %>.html">
                                <%if (LIST_NEWS[i].NEWS_TITLE.Length > 8) Response.Write(LIST_NEWS[i].NEWS_TITLE.Substring(0, 8) + "..."); else Response.Write(LIST_NEWS[i].NEWS_TITLE); %></a>
                            </strong>
                        
                        <p class="cleanFlex">
                            <b class="f_right"><a target="_blank" href="/wanjia/<%=LIST_NEWS[i].NJL_PERSON_ID %>-index.html">
                                <%=GetUserByID(LIST_NEWS[i].NJL_PERSON_ID).USER_NAME%></a> </b>
                            <%
                if (LIST_NEWS[i].NEWS_TAG != "")
                {
                            %>
                            [<%=PageValidate.SqlText(LIST_NEWS[i].NEWS_TAG, 10)%>]
                            <%
                }
                            %>
                        </p>
                    </li>
                    <% 
                }
                    %>
                </ul>
            </div>
        </div>
    </div>
</div>
